]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st-texture-cache: use StImageContent for cairo bound surface
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Fri, 1 Mar 2019 05:56:26 +0000 (06:56 +0100)
committerJonas Ådahl <jadahl@gmail.com>
Fri, 1 Mar 2019 17:12:53 +0000 (17:12 +0000)
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/5

js/ui/ctrlAltTab.js
src/shell-app.c
src/st/st-texture-cache.c
src/st/st-texture-cache.h

index 146f8ead9dbf7d40f5c382fad0848a5ae341f802..338080fc479b7f5baa349b69cd3277807bbe091e 100644 (file)
@@ -94,7 +94,9 @@ var CtrlAltTabManager = class CtrlAltTabManager {
                     if (app)
                         icon = app.create_icon_texture(POPUP_APPICON_SIZE);
                     else
-                        icon = textureCache.bind_cairo_surface_property(windows[i], 'icon');
+                        icon = textureCache.bind_cairo_surface_property(windows[i],
+                                                                        'icon',
+                                                                        POPUP_APPICON_SIZE);
                 }
 
                 items.push({ name: windows[i].title,
index 5a0f81d52cbcaa28254680612a2c28e2c637c712..3f91613fabfc78fb05cc3404694eadf00c1308d5 100644 (file)
@@ -211,8 +211,8 @@ window_backed_app_get_icon (ShellApp *app,
 
   actor = st_texture_cache_bind_cairo_surface_property (st_texture_cache_get_default (),
                                                         G_OBJECT (window),
-                                                        "icon");
-  g_object_set (actor, "width", (float) size, "height", (float) size, NULL);
+                                                        "icon",
+                                                        size);
   return actor;
 }
 
index ae5ac09cb46e098b0f13eb6dc86cf9ad1c91cd80..6da186fba4a9c72085b3a3d252d059cf9eca4648 100644 (file)
@@ -679,6 +679,7 @@ load_texture_async (StTextureCache       *cache,
 typedef struct {
   StTextureCache *cache;
   ClutterActor *actor;
+  gint size;
   GObject *source;
   guint notify_signal_id;
   gboolean weakref_active;
@@ -702,7 +703,7 @@ st_texture_cache_reset_texture (StTextureCachePropertyBind *bind,
 
       image = clutter_actor_get_content (bind->actor);
       if (!image || !CLUTTER_IS_IMAGE (image))
-        image = clutter_image_new ();
+        image = st_image_content_new_with_preferred_size (bind->size, bind->size);
       else
         g_object_ref (image);
 
@@ -771,17 +772,20 @@ st_texture_cache_free_bind (gpointer data)
 ClutterActor *
 st_texture_cache_bind_cairo_surface_property (StTextureCache    *cache,
                                               GObject           *object,
-                                              const char        *property_name)
+                                              const char        *property_name,
+                                              gint               size)
 {
   ClutterActor *actor;
   gchar *notify_key;
   StTextureCachePropertyBind *bind;
 
-  actor = clutter_actor_new ();
+  actor = create_invisible_actor ();
+  clutter_actor_set_size (actor, size, size);
 
   bind = g_new0 (StTextureCachePropertyBind, 1);
   bind->cache = cache;
   bind->actor = actor;
+  bind->size = size;
   bind->source = object;
   g_object_weak_ref (G_OBJECT (actor), st_texture_cache_bind_weak_notify, bind);
   bind->weakref_active = TRUE;
index 0e0202c50adb875bfacdf9e8b758e99207a7ad74..a3311a86290398d25b5f1ad4b3ac34280726313a 100644 (file)
@@ -65,7 +65,8 @@ st_texture_cache_load_sliced_image (StTextureCache *cache,
 
 ClutterActor *st_texture_cache_bind_cairo_surface_property (StTextureCache    *cache,
                                                             GObject           *object,
-                                                            const char        *property_name);
+                                                            const char        *property_name,
+                                                            gint               size);
 
 ClutterActor *st_texture_cache_load_gicon (StTextureCache *cache,
                                            StThemeNode    *theme_node,